]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
legacyTray: Add to ctrl-alt-tab
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 11 Mar 2015 19:44:10 +0000 (20:44 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Fri, 13 Mar 2015 16:12:10 +0000 (17:12 +0100)
While legacy status icons are notoriously bad with regard to
accessibility (well, among many other things), we should still
make them available via ctrl-alt-tab ...

https://bugzilla.gnome.org/show_bug.cgi?id=746022

js/ui/legacyTray.js
po/POTFILES.in

index f3d8613a08c15453ef396e933c954e87f1bdd0f2..8c23167eddd9173d40f699289f7a478777d6d1a4 100644 (file)
@@ -3,6 +3,7 @@ const GObject = imports.gi.GObject;
 const Shell = imports.gi.Shell;
 const St = imports.gi.St;
 
+const CtrlAltTab = imports.ui.ctrlAltTab;
 const Lang = imports.lang;
 const Layout = imports.ui.layout;
 const Main = imports.ui.main;
@@ -53,7 +54,10 @@ const LegacyTray = new Lang.Class({
         this._box = new St.BoxLayout();
         this._slider.add_actor(this._box);
 
-        this._concealHandle = new St.Button({ style_class: 'legacy-tray-handle' });
+        this._concealHandle = new St.Button({ style_class: 'legacy-tray-handle',
+                                              /* translators: 'Hide' is a verb */
+                                              accessible_name: _("Hide tray"),
+                                              can_focus: true });
         this._concealHandle.child = new St.Icon({ icon_name: 'go-previous-symbolic' });
         this._box.add_child(this._concealHandle);
 
@@ -83,6 +87,9 @@ const LegacyTray = new Lang.Class({
 
         Main.layoutManager.addChrome(this.actor, { affectsInputRegion: false });
         Main.layoutManager.trackChrome(this._slider, { affectsInputRegion: true });
+        Main.ctrlAltTabManager.addGroup(this.actor,
+                                        _("Status Icons"), 'focus-legacy-systray-symbolic',
+                                        { sortGroup: CtrlAltTab.SortGroup.BOTTOM });
 
         this._trayManager = new Shell.TrayManager();
         this._trayIconAddedId = this._trayManager.connect('tray-icon-added', Lang.bind(this, this._onTrayIconAdded));
@@ -121,14 +128,20 @@ const LegacyTray = new Lang.Class({
             return;
 
         let button = new St.Button({ child: icon,
+                                     style_class: 'legacy-tray-icon',
                                      button_mask: St.ButtonMask.ONE |
                                                   St.ButtonMask.TWO |
                                                   St.ButtonMask.THREE,
+                                     can_focus: true,
                                      x_fill: true, y_fill: true });
         button.connect('clicked',
             function() {
                 icon.click(Clutter.get_current_event());
             });
+        button.connect('key-focus-in', Lang.bind(this,
+            function() {
+                this._concealHandle.show();
+            }));
 
         this._iconBox.add_actor(button);
         this._sync();
index 69942b86d08ba8eab20829dc418ec5e40a7b4862..aa535bb7d124d75f39468f6892e720818ab7093d 100644 (file)
@@ -30,6 +30,7 @@ js/ui/endSessionDialog.js
 js/ui/extensionDownloader.js
 js/ui/extensionSystem.js
 js/ui/keyboard.js
+js/ui/legacyTray.js
 js/ui/lookingGlass.js
 js/ui/main.js
 js/ui/messageTray.js